package com.nts.visionworks.business.schedule.domain;

// Generated 2013. 6. 23 ���� 6:33:40 by Hibernate Tools 4.0.0

import javax.persistence.AttributeOverride;
import javax.persistence.AttributeOverrides;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import com.nts.visionworks.core.validation.EntityIdNotNull;

/**
 * ScheduleOperationTrace generated by hbm2java
 */
@Entity
@Table(name = "schedule_operation_trace", catalog = "visionworks")
public class ScheduleOperationTrace implements java.io.Serializable
{

	private ScheduleOperationTraceId id;
	private Schedule schedule;

	public ScheduleOperationTrace()
	{
	}

	public ScheduleOperationTrace(ScheduleOperationTraceId id, Schedule schedule)
	{
		this.id = id;
		this.schedule = schedule;
	}

	@EmbeddedId
	@AttributeOverrides(
	{
			@AttributeOverride(name = "operatedDateTime", column = @Column(name = "OperatedDateTime", nullable = false, length = 19)),
			@AttributeOverride(name = "scheduleId", column = @Column(name = "ScheduleId", nullable = false)) })
	public ScheduleOperationTraceId getId()
	{
		return this.id;
	}

	public void setId(ScheduleOperationTraceId id)
	{
		this.id = id;
	}

	@EntityIdNotNull(message= "validation.scheduleOperationTrace.schedule.notNull")
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "ScheduleId", nullable = false, insertable = false, updatable = false)
	public Schedule getSchedule()
	{
		return this.schedule;
	}

	public void setSchedule(Schedule schedule)
	{
		this.schedule = schedule;
	}

}
